package stone.ast;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import runner.Environment;

import java.util.List;

public class BlockStmt extends ASTList {
  public BlockStmt(List<ASTree> list) {
    super(list);
  }

  @NotNull
  @Override
  public Object eval(@Nullable Environment env) {
    Object result = 0;
    for (ASTree t : this) {
      if (!(t instanceof NullStmt))
        result = t.eval(env);
    }
    return result;
  }
}
